const mongoose = require("mongoose");
const mongoUri = "mongodb://127.0.0.1:27017/myDb"

const connectToDatabase = async () => {
    try {
        console.log('触发了');
        
        const res = await mongoose.connect(mongoUri);
        console.log("Connected to database");
    } catch (error) {
        console.log(error);
    }
}
module.exports  = {
    connectToDatabase
}